<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script language="javascript" src="<%=contextPath%>/js/sorttable.js"type=""></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/css/sorttable.css">
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-',
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        },'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			<s:hidden name="searchBean.displayFlag" />		
			<s:hidden name="searchBean.con1" />
			<s:hidden name="searchBean.con5" />
			<s:hidden name="searchBean.con6" />
			<s:hidden name="searchBean.con10" />
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th style="width:100">
						统计日期：
					</th>
					<td width="230">
						<input type="text"  readonly="true" name="searchBean.con2" size="8"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" id="searchBean.con2" value="${searchBean.con2}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text"  readonly="true" name="searchBean.con3" size="8" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" id="searchBean.con3" value="${searchBean.con3}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<!--<th style="width:60">
						变电站：
					</th>
					<td>
						<input type="text" readonly="true" name="searchBean.con4" size="15" id="searchBean.con4" value="${searchBean.con4}"/>
						<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="选择变电站" 
						onClick="javascript:getBdz('searchBean.con5','searchBean.con4','searchBean.con6')" />
					</td>-->
					<th style="width:60">
						人员：
					</th>
					<td >
					    <input type="text"   readonly="true" style="width:60" name="searchBean.con9" value="${searchBean.con9}" >
						<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getUserselect('searchBean.con10','searchBean.con9')" />
					</td>
					<!--<th style="width:60">
						设备类型：
					</th>
					<td >
						<s:select list="sblxList" emptyOption="true" onchange="javascript:cmt()" name="searchBean.con8"  style="width:100" listKey="itemId" listValue="itemName"/>
					</td>
					<th style="width:60">
						设备名称：
					</th>
					<td style="width:150">
					<!--<input type="text"   name="searchBean.con7"   id="searchBean.con7" value="${searchBean.con7}"/>&nbsp;-->
					<!--<input type="text"  style="width:80%" readonly="true"  name="searchBean.con7" value="${searchBean.con7}"  />
					<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getSB('${searchBean.con5}')" />
					</td>
			        <th style="width:40">班组：</th>
					<td>
						<s:select list="bzList" emptyOption="true" onchange="javascript:cmt()" name="searchBean.con18" style="width:100" listKey="id" listValue="organName"/>
					</td>-->
				</tr>
				</tbody>
			</table>
			<hr><center><b>员工考勤统计表</b></center>
			<table width="100%" >
			
				<tr>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="150" colspan="1">未在班内上班天数</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="40"><font color="red"><c:out value="${wzbts_total}"/></font></td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;text-align:center;" align="center" width="150" colspan="1">周六、周日加班天数</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;text-align:center;" width="80" ><font color="red"><c:out value="${zmts_total}"/></font></td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="150">夜间加班天数</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="40"><font color="red"><c:out value="${yjjbts_total}"/></font></td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="150">调休天数</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="40"><font color="red"><c:out value="${txts_total}"/></font></td>
	                
				</tr>
               <tr>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" colspan="2" valign="top">
					 <table width="100%" border=1 >
					 <tr>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">日期</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">天数</td>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">原因</td>
					 </tr>
					 <c:forEach items="${kqList}" var="detail" >
					<c:if test="${searchBean.con15 == detail.id}">
						<tr  style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr >
					</c:if>
						
						 <td width="80" nowrap="nowrap">
						<fmt:formatDate value="${detail.kqrq}" pattern="yyyy-MM-dd"/>		
						</td>
						<td width="60" style="text-align:center">
							<c:out value="${detail.qqts}"/>
						</td>
						<td >
							<c:out value="${detail.qqyy}"/>
						</td>
					</tr>
				</c:forEach>
					 </table>
					 </td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" colspan="2" valign="top">
					 <table width="100%" border=1>
					 <tr>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">日期</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">变电站</td>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">任务</td>
					 </tr>
					 <c:forEach items="${zmList}" var="detail" >
					<c:if test="${searchBean.con15 == detail.id}">
						<tr  style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr >
					</c:if>
						
						 <td width="80">
						<fmt:formatDate value="${detail.rq}" pattern="yyyy-MM-dd"/>		
						</td>
						<td width="60" style="text-align:center">
							<c:out value="${detail.bdzname}"/>
						</td>
						<td >
							<c:out value="${detail.gznr}"/>
						</td>
					</tr>
				</c:forEach>
					 </table></td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" colspan="2" valign="top">
					 <table width="100%" border=1>
					 <tr>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">日期</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">变电站</td>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">任务</td>
					 </tr>
					 <c:forEach items="${yjList}" var="detail" >
					<c:if test="${searchBean.con15 == detail.id}">
						<tr  style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr >
					</c:if>
						
						 <td width="80">
						<fmt:formatDate value="${detail.rq}" pattern="yyyy-MM-dd"/>		
						</td>
						<td width="60" style="text-align:center">
							<c:out value="${detail.bdzname}"/>
						</td>
						<td >
							<c:out value="${detail.gznr}"/>
						</td>
					</tr>
				</c:forEach>
					 </table></td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" colspan="2" valign="top">
					 <table width="100%" border=1>
					 <tr>
					  <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">开始日期</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">结束日期</td>
					  
					 </tr>
					 <c:forEach items="${txList}" var="detail" >
					<c:if test="${searchBean.con15 == detail.id}">
						<tr  style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr >
					</c:if>
						
						 <td width="80">
						<fmt:formatDate value="${detail.ksrq}" pattern="yyyy-MM-dd"/>		
						</td>
						 <td width="80">
						<fmt:formatDate value="${detail.jsrq}" pattern="yyyy-MM-dd"/>		
						</td>
					</tr>
				</c:forEach>
					 </table></td>
				</tr>
			</table>
			
		</form>
		</div>
	</body>
</html>
<script type="text/javascript">
	//var st = new SortableTable(document.getElementById("listtab"),["None","String","String","String","String","String","String", "None","None","String","String","None"]);
</script>
<script language="javascript">

			// 查询
			function cmt(obj){
				document.frmM.action = "<%=contextPath%>/ygkqtjList!getList.do?page=1&c=c&searchBean.con15=";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(id){
				//document.frmM.action = "<%=contextPath%>/gzrwd!initDetail.do?id=" + id;
				//uncheck("id");
				//document.frmM.submit();
				parent.addTab("任务单明细", "<%=contextPath%>/gzrwd!initDetail.do?id=" + id,id);
    
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/gzrwd!delete.do?searchBean.con15=";
					document.frmM.submit();
		    	}
			}
			// 新建修改进入详细页面
			function toDetailWp(id){
				parent.addTab("生产工作安排【无票】明细", "<%=contextPath%>/gzrwdWp!initDetail.do?id=" + id,id);
    
			}
			// 获得设备
	function getSB(bdzid) {
		var url = "/DLPLANMIS/jsp/business/gzrwd/selectSB.jsp?bdzid="+bdzid;
		var win = openSUB(url,2,300,520,450,30);
	}
		</script>